import { Result, Button } from 'antd';
import React from 'react';
import { history } from 'umi';

// https://github.com/umijs/umi/issues/5081 按照这个方法解决404
// const NoFoundPage: { (): JSX.Element; path: any; } = ()=>{
//     return <Result
//     status="403"
//     title="403"
//     subTitle="Sorry, you are not authorized to access this page."
//     extra={<Button type="primary" onClick={()=>{
//       history.push('/')
//     }}>Back Home</Button>}
//   />
// }

// // !!!这里覆盖掉 path 的值!!!
// NoFoundPage.path = undefined;

// export default NoFoundPage;

export default () => {
  return (
    <Result
      status="403"
      title="403"
      subTitle="Sorry, you are not authorized to access this page."
      extra={
        <Button
          type="primary"
          onClick={() => {
            history.push('/');
          }}
        >
          Back Home
        </Button>
      }
    />
  );
};
